package br.com.imob.modelo;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Gilton Nascimento
 */
@Entity
@Table(name = "\"CLASSIFICACAO\"", catalog = "imob", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Classificacao.findAll", query = "SELECT c FROM Classificacao c"),
    @NamedQuery(name = "Classificacao.findByClassificacaoId", query = "SELECT c FROM Classificacao c WHERE c.classificacaoId = :classificacaoId"),
    @NamedQuery(name = "Classificacao.findByClassificacao", query = "SELECT c FROM Classificacao c WHERE c.classificacao = :classificacao"),
    @NamedQuery(name = "Classificacao.findLikeByClassificacao", query = "SELECT c FROM Classificacao c WHERE c.classificacao Like :classificacao"),
    @NamedQuery(name = "Classificacao.findByClassificacaoDsc", query = "SELECT c FROM Classificacao c WHERE c.classificacaoDsc = :classificacaoDsc"),
    @NamedQuery(name = "Classificacao.findLikeByClassificacaoDsc", query = "SELECT c FROM Classificacao c WHERE c.classificacaoDsc Like :classificacaoDsc")
    })
public class Classificacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
//  <editor-fold defaultstate="collapsed" desc="Geradores de Sequencias">
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_STORE")
    @SequenceGenerator(name = "SEQ_STORE", sequenceName = "next_classificacao")// </editor-fold>
    @Basic(optional = false)
    @Column(name = "classificacao_id", nullable = false)
    private Integer classificacaoId;
    @Basic(optional = false)
    @Column(name = "classificacao", nullable = false, length = 50)
    private String classificacao;
    @Column(name = "classificacao_dsc", length = 80)
    private String classificacaoDsc;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "classificacao", fetch = FetchType.LAZY)
    private List<Imovel> imovelList;

    public Classificacao() {
    }

    public Classificacao(Integer id) {
        classificacaoId = id;
    }
    
    public Classificacao(String classific) {
    	classificacao = classific;
    }

    public Classificacao(Integer id, String classif) {
    	classificacaoId = id;
    	classificacao = classif;
    }

	public Classificacao(int id, String classif, String desc) {
		this(id, classif);
		classificacaoDsc = desc;
	}

	public Integer getClassificacaoId() {
        return classificacaoId;
    }

    public void setClassificacaoId(Integer classificacaoId) {
        this.classificacaoId = classificacaoId;
    }

    public String getClassificacao() {
        return classificacao;
    }

    public void setClassificacao(String classificacao) {
        this.classificacao = classificacao;
    }

    public String getClassificacaoDsc() {
        return classificacaoDsc;
    }

    public void setClassificacaoDsc(String classificacaoDsc) {
        this.classificacaoDsc = classificacaoDsc;
    }

    public List<Imovel> getImovelList() {
        return imovelList;
    }

    public void setImovelList(List<Imovel> imovelList) {
        this.imovelList = imovelList;
    }

    public Object[] getValues() {
    	Object[] objects = { classificacaoId, classificacao, classificacaoDsc };
    	return objects; 
    }
    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (classificacaoId != null ? classificacaoId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Classificacao)) {
            return false;
        }
        Classificacao other = (Classificacao) object;
        if ((this.classificacaoId == null && other.classificacaoId != null) || (this.classificacaoId != null && !this.classificacaoId.equals(other.classificacaoId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.imob.modelo.Classificacao[classificacaoId=" + classificacaoId + "]";
    }

}